<?php

namespace console\controllers;

use Yii;
use yii\console\Controller;
use Exception;

/**
 * 定时删除本地服务器图片
 *
 * Class MsgHistoryController
 * @package console\controllers
 */
class ImageClearController extends Controller
{
    /**
     * 清理15天前的数据
     */
    public function actionIndex()
    {
        try {
            Yii::$app->services->ossImgRecord->clearHistoryImage();
            echo 'success!';
        } catch (Exception $exception) {
            echo 'error:' . $exception;
        }
    }
}
